<template>
	<view class="product-item" @click="goRouter('/pages/detail/detail',{id:good.id,type:'good'})">
		<image src="https://z3.ax1x.com/2021/08/08/f1ZdUA.jpg" mode="aspectFill" class="pro-img"></image>
		<view class="p-20">
			<view class="fz24 c-333">2020时尚新款夏季女装轻熟风气质穿搭洋…</view>
			<view class="c-ae fz22">货号：021021023</view>
			<view class="c-fe fz36 fw-b">￥128.00</view>
			
		</view>
		<image src="../static/imgs/car-1.png" v-if="show" @click="addCar(true)" mode="" class="car"></image>
		<image src="../static/imgs/car-2.png" v-if="!show" mode="" @click="addCar(false)" class="car"></image>
	</view>
</template>

<script>
	export default {
		props:{
			good:{
				type:Object
			}
		},
		data() {
			return {
				show:false
			};
		},
		methods:{
			addCar(data) {
				this.show = !this.show
			}
		}
	}
</script>

<style lang="scss">
.product-item {
	// margin-right: 30rpx;
	// &:nth-child(2n) {
	// 	margin-right: 0;
	// }
	box-shadow: 0px 7rpx 29rpx -5rpx rgba(114,124,142,0.11);
	flex: 0 0 48%;
	position: relative;
	margin-bottom: 40rpx;
	border-radius: 14rpx;
	.pro-img {
		width: 330rpx;
		height: 430rpx;
		border-radius: 14rpx;
	}
	.car {
		width: 40rpx;
		height: 40rpx;
		border-radius: 50%;
		position: absolute;
		right: 20rpx;
		bottom: 20rpx;
	}
}
</style>
